package com.example.bot_cc.socket;

import android.os.Handler;
import android.os.Message;

import java.net.InetAddress;

/**
 * Created by BOT-CC on 2017/4/26.
 */

public class MySocket extends Thread {
    public Handler handler;
    public MySocket(Handler handler){
        this.handler = handler;
    }
    public void run(){
        try{
            InetAddress ip = InetAddress.getLocalHost();
            Message tempmsg = handler.obtainMessage();
            tempmsg.obj = ip.getHostAddress();
            handler.sendMessage(tempmsg);
        }
        catch (Exception e){
            e.printStackTrace();
        }
    }
}
